﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.OleDb;
using System.Text;
using SystemHelper;

/// <summary>
/// User 的摘要说明
/// </summary>
public class User
{
	public User()
	{
		//
		// TODO: 在此处添加构造函数逻辑
		//
	}

    public OleDbDataReader GetUser()
    { OleDbDataReader dr = null;
    StringBuilder sqlStr = new StringBuilder();
        sqlStr.Append(" SELECT ");
        sqlStr.Append(" UID, ");
        sqlStr.Append(" UNAME, ");
        sqlStr.Append(" EMPID, ");
        sqlStr.Append(" UPro ");
        sqlStr.Append(" FROM ");
        sqlStr.Append(" TB_UserInfo ");
        sqlStr.Append(" where Upro<>9999 ");
        sqlStr.Append(" order by UID ");
        OledbHelper ohp = new OledbHelper();
        ohp.RunSQL(sqlStr.ToString(), out dr);
        return dr;
}

    public OleDbDataReader GetUserLogin(string name, string pass)
    {   OleDbDataReader dr = null;
    StringBuilder sqlStr = new StringBuilder();
        sqlStr.Append(" SELECT ");
        sqlStr.Append(" UID, ");
        sqlStr.Append(" UNAME, ");
        sqlStr.Append(" EMPID, ");
        sqlStr.Append(" UPro ");
        sqlStr.Append(" FROM ");
        sqlStr.Append(" TB_UserInfo ");
        sqlStr.Append(" WHERE ");
        sqlStr.Append(" UID = ");
        sqlStr.Append("'" + name + "'");
        sqlStr.Append("  and ");
        sqlStr.Append(" PASS = ");
        sqlStr.Append("'" + pass + "'");
        OledbHelper ohp = new OledbHelper();
        ohp.RunSQL(sqlStr.ToString(), out dr);
        return dr;
    }
}
